package template_method

import "fmt"

type Template struct {
	Step
}

func NewTemplate(s Step) *Template {
	return &Template{s}
}

func (t *Template) Run() {
	t.Step1()
	t.Step2()
	t.Step3()
	t.Step4()
}

func (t *Template) Step1() {
	fmt.Println("1")
}

func (t *Template) Step3() {
	fmt.Println("3")
}

type Step interface {
	Step2()
	Step4()
}
